/*
    Copyright (c) 2003-2016 Pentair Technical Products, Inc.
    All rights reserved.
    Pentair Technical Products, Inc. proprietary and confidential.

    Description:
	This header file defines IPMI-specific
	constants, macros and data types.

    $Revision: 13617 $
*/

#ifndef __IPMIDEFS_H__
#define __IPMIDEFS_H__

/*
    Maximum IPMI message size for each channel
*/

#define IPMI_MAX_IPMB_MESSAGE_SIZE		32
#define IPMI_MAX_IPMB_DATA_SIZE			\
    (IPMI_MAX_IPMB_MESSAGE_SIZE -		\
	    (sizeof(ipmb_msg_header_t) + 1 /* IPMB message checksum */))

/* Maximum size of a message sent via the payload interface should
   be big enough for bridging SMBus 2.0 Write Block with PEC (35 bytes)
   using the Master Write-Read command (2 bytes) */
#define IPMI_MAX_PI_MSG_DATA_SIZE		37

#define IPMI_MAX_SIPL_TM_DATA_SIZE		IPMI_MAX_PI_MSG_DATA_SIZE
#define IPMI_MAX_SIPL_TM_MESSAGE_SIZE		\
    (IPMI_MAX_SIPL_TM_DATA_SIZE + sizeof(uart_tm_msg_header_t))

#define IPMI_MAX_SIPL_BM_DATA_SIZE		IPMI_MAX_PI_MSG_DATA_SIZE
#define IPMI_MAX_SIPL_BM_MESSAGE_SIZE		\
    (IPMI_MAX_SIPL_BM_DATA_SIZE + sizeof(ipmb_msg_header_t) + 1 /* crc */)

#define IPMI_MAX_KCS_DATA_SIZE			IPMI_MAX_PI_MSG_DATA_SIZE
#define IPMI_MAX_KCS_MESSAGE_SIZE		\
    (IPMI_MAX_KCS_DATA_SIZE + sizeof(kcs_msg_header_t))

/* Based on minimun FIFO requirements in IPMI, 1 byte for length */
#define IPMI_MAX_BT_MESSAGE_SIZE		(64 - 1)
#define IPMI_MAX_BT_DATA_SIZE			\
    (IPMI_MAX_BT_MESSAGE_SIZE - sizeof(bt_msg_header_t))

#define IPMI_MAX_LAN_DATA_SIZE                 IPMI_MAX_PI_MSG_DATA_SIZE

#define IPMI_LAN_PARAM_REV                              0x1

/* Network function codes */
#define IPMI_NETFN_CHASSIS                              0x00
#define IPMI_NETFN_BRIDGE                               0x02
#define IPMI_NETFN_SENSOR_EVENT                         0x04
#define IPMI_NETFN_APP                                  0x06
#define IPMI_NETFN_FIRMWARE                             0x08
#define IPMI_NETFN_STORAGE                              0x0A
#define IPMI_NETFN_TRANSPORT                            0x0C
#define IPMI_NETFN_GROUP_EXT                            0x2C
#define IPMI_NETFN_OEM_GROUP                            0x2E
#define IPMI_NETFN_CS_OEM_GROUP                         0x30

#define MAKE_NETFN_LUN( netFn, resp, lun )  (((netFn) | (resp)) << 2 | (lun))

/*  Command completion codes */
#define IPMI_SUCCESS                                    0x00
#define IPMI_NODE_BUSY                                  0xC0
#define IPMI_INVALID_COMMAND                            0xC1
#define IPMI_COMMAND_INVALID_FOR_LUN                    0xC2
#define IPMI_TIMEOUT                                    0xC3
#define IPMI_OUT_OF_SPACE                               0xC4
#define IPMI_RESERVATION_INVALID_OR_CANCELED            0xC5
#define IPMI_REQUEST_DATA_TRUNCATED                     0xC6
#define IPMI_REQUEST_DATA_LENGTH_INVALID                0xC7
#define IPMI_REQUEST_DATA_LENGTH_LIMIT_EXCEEDED         0xC8
#define IPMI_PARAMETER_OUT_OF_RANGE                     0xC9
#define IPMI_CANNOT_RETURN_NUMBER_OF_REQUESTED_BYTES    0xCA
#define IPMI_REQUESTED_DATA_NOT_PRESENT                 0xCB
#define IPMI_INVALID_DATA_IN_REQUEST                    0xCC
#define IPMI_COMMAND_ILLEGAL_FOR_SPECIFIED_OBJECT       0xCD
#define IPMI_CANNOT_PROVIDE_COMMAND_RESPONSE            0xCE
#define IPMI_CANNOT_EXECUTE_DUPLICATED_REQUEST          0xCF
#define IPMI_SDR_REPOSITORY_IN_UPDATE_MODE              0xD0
#define IPMI_DEVICE_IN_FIRMWARE_UPDATE_MODE             0xD1
#define IPMI_INITIALIZATION_IN_PROGRESS                 0xD2
#define IPMI_DESTINATION_UNAVAILABLE                    0xD3
#define IPMI_INSUFFICIENT_PRIVILEGE_LEVEL               0xD4
#define IPMI_COMMAND_NOT_SUPPORTED_IN_PRESENT_STATE     0xD5
#define IPMI_COMMAND_NOT_SUPPORTED_SUBFUNCTION_DISABLED 0xD6
#define IPMI_WRITE_PROTECTED_OFFSET			0x80
#define IPMI_READ_ONLY_PARAMETER                        0x82
#define IPMI_UNSPECIFIED_ERROR                          0xFF

/*
    Generic event/reading type codes
*/

#define IPMI_EVENT_READING_THRESHOLD                    1
#define IPMI_EVENT_READING_DMI_USAGE_STATE              2
#define IPMI_EVENT_READING_STATE                        3
#define IPMI_EVENT_READING_PREDICTIVE_FAILURE           4
#define IPMI_EVENT_READING_LIMIT                        5
#define IPMI_EVENT_READING_PERFORMANCE                  6
#define IPMI_EVENT_READING_SEVERITY                     7
#define IPMI_EVENT_READING_DEVICE_PRESENCE              8
#define IPMI_EVENT_READING_DEVICE_ENABLED               9
#define IPMI_EVENT_READING_DEVICE_STATE_CHANGE          0xA
#define IPMI_EVENT_READING_REDUNDANCY_STATE             0xB
#define IPMI_EVENT_READING_ACPI_DEVICE_POWER_STATE      0xC
#define IPMI_EVENT_READING_SENSOR_SPECIFIC              0x6F

#define IPMI_EVENT_READING_OEM_MIN                      0x70
#define IPMI_EVENT_READING_OEM_MAX                      0x7F

#define IPMI_EVENT_DIRECTION_MASK			0x80

/* Offsets for PREDICTIVE FAILURE reading type */
#define SENSOR_PREDICTIVE_FAILURE_UNKNOWN	0
#define SENSOR_PREDICTIVE_FAILURE_DEASSERTED	(1 << 0)
#define SENSOR_PREDICTIVE_FAILURE_ASSERTED	(1 << 1)

/*
    Sensor type codes
*/
#define IPMI_SENSOR_TEMPERATURE                         0x01
#define IPMI_SENSOR_VOLTAGE                             0x02
#define IPMI_SENSOR_CURRENT                             0x03
#define IPMI_SENSOR_FAN                                 0x04
#define IPMI_SENSOR_PHYSICAL_SECURITY                   0x05
#define IPMI_SENSOR_PLATFORM_SECURITY_VIOLATION         0x06
#define IPMI_SENSOR_PROCESSOR                           0x07
#define IPMI_SENSOR_POWER_SUPPLY                        0x08
#define IPMI_SENSOR_POWER_UNIT                          0x09
#define IPMI_SENSOR_COOLING_DEVICE                      0x0A
#define IPMI_SENSOR_OTHER_UNITS_BASED                   0x0B
#define IPMI_SENSOR_MEMORY                              0x0C
#define IPMI_SENSOR_DRIVE_SLOT                          0x0D
#define IPMI_SENSOR_POST_MEMORY_RESIZE                  0x0E
#define IPMI_SENSOR_SYSTEM_FIRMWARE_PROGRESS            0x0F
#define IPMI_SENSOR_EVENT_LOGGING_DISABLED              0x10
#define IPMI_SENSOR_WATCHDOG1                           0x11
#define IPMI_SENSOR_SYSTEM_EVENT                        0x12
#define IPMI_SENSOR_CRITICAL_INTERRUPT                  0x13
#define IPMI_SENSOR_BUTTON                              0x14
#define IPMI_SENSOR_MODULE_BOARD                        0x15
#define IPMI_SENSOR_MICROCONTROLLER_COPROCESSOR         0x16
#define IPMI_SENSOR_ADD_IN_CARD                         0x17
#define IPMI_SENSOR_CHASSIS                             0x18
#define IPMI_SENSOR_CHIPSET                             0x19
#define IPMI_SENSOR_OTHER_FRU                           0x1A
#define IPMI_SENSOR_CABLE_INTERCONNECT                  0x1B
#define IPMI_SENSOR_TERMINATOR                          0x1C
#define IPMI_SENSOR_SYSTEM_BOOT_INITIATED               0x1D
#define IPMI_SENSOR_BOOT_ERROR                          0x1E
#define IPMI_SENSOR_OS_BOOT                             0x1F
#define IPMI_SENSOR_OS_CRITICAL_STOP                    0x20
#define IPMI_SENSOR_SLOT_CONNECTOR                      0x21
#define IPMI_SENSOR_SYSTEM_ACPI_POWER_STATE             0x22
#define IPMI_SENSOR_WATCHDOG2                           0x23
#define IPMI_SENSOR_PLATFORM_ALERT                      0x24
#define IPMI_SENSOR_ENTITY_PRESENCE                     0x25
#define IPMI_SENSOR_MONITOR_ASIC_IC                     0x26
#define IPMI_SENSOR_LAN                                 0x27
#define IPMI_SENSOR_MANAGEMENT_SUBSYSTEM_HEALTH         0x28
#define IPMI_SENSOR_BATTERY                             0x29
#define IPMI_SENSOR_VERSION_CHANGE			0x2B

/*
    OEM Sensor types
*/
#define IPMI_SENSOR_GPIO				0xC0
#define IPMI_SENSOR_META				0xC1
#define IPMI_SENSOR_IRQ					0xC5

/*
    Entity IDs
*/
#define IPMI_ENTITY_ID_OTHER				0x01
#define IPMI_ENTITY_ID_UNKNOWN				0x02
#define IPMI_ENTITY_ID_PROCESSOR			0x03
#define IPMI_ENTITY_ID_DISK_DMI				0x04
#define IPMI_ENTITY_ID_PERIPHERAL_BAY_DMI		0x05
#define IPMI_ENTITY_ID_SYSTEM_MANAGEMENT_MODULE		0x06
#define IPMI_ENTITY_ID_SYSTEM_BOARD			0x07
#define IPMI_ENTITY_ID_MEMORY_MODULE			0x08
#define IPMI_ENTITY_ID_PROCESSOR_MODULE			0x09
#define IPMI_ENTITY_ID_POWER_SUPPLY			0x0A
#define IPMI_ENTITY_ID_ADDIN_CARD			0x0B
#define IPMI_ENTITY_ID_FRONT_PANEL_BOARD		0x0C
#define IPMI_ENTITY_ID_BACK_PANEL_BOARD			0x0D
#define IPMI_ENTITY_ID_POWER_SYSTEM_BOARD		0x0E
#define IPMI_ENTITY_ID_DRIVE_BACKPLANE			0x0F
#define IPMI_ENTITY_ID_SYSTEM_EXPANSION_BOARD		0x10
#define IPMI_ENTITY_ID_OTHER_SYSTEM_BOARD		0x11
#define IPMI_ENTITY_ID_PROCESSOR_BOARD			0x12
#define IPMI_ENTITY_ID_POWER_UNIT			0x13
#define IPMI_ENTITY_ID_POWER_MODULE			0x14
#define IPMI_ENTITY_ID_POWER_MANAGEMENT			0x15
#define IPMI_ENTITY_ID_CHASSIS_BACK_PANEL_BOARD		0x16
#define IPMI_ENTITY_ID_SYSTEM_CHASSIS			0x17
#define IPMI_ENTITY_ID_SUB_CHASSIS			0x18
#define IPMI_ENTITY_ID_OTHER_CHASSIS			0x19
#define IPMI_ENTITY_ID_DISK_DRIVE_BAY			0x1A
#define IPMI_ENTITY_ID_PERIPHERAL_BAY			0x1B
#define IPMI_ENTITY_ID_DEVICE_BAY			0x1C
#define IPMI_ENTITY_ID_FAN				0x1D
#define IPMI_ENTITY_ID_COOLING_UNIT			0x1E
#define IPMI_ENTITY_ID_CABLE				0x1F
#define IPMI_ENTITY_ID_MEMORY_DEVICE			0x20
#define IPMI_ENTITY_ID_SYSTEM_MANAGEMENT_SOFTWARE	0x21
#define IPMI_ENTITY_ID_SYSTEM_FIRMWARE			0x22
#define IPMI_ENTITY_ID_OPERATING_SYSTEM			0x23
#define IPMI_ENTITY_ID_SYSTEM_BUS			0x24
#define IPMI_ENTITY_ID_GROUP				0x25
#define IPMI_ENTITY_ID_REMOTE_MANAGEMENT_DEVICE		0x26
#define IPMI_ENTITY_ID_EXTERNAL_ENVIRONMENT		0x27
#define IPMI_ENTITY_ID_BATTERY				0x28
#define IPMI_ENTITY_ID_PROCESSING_BLADE			0x29
#define IPMI_ENTITY_ID_CONNECTIVITY_SWITCH		0x2A
#define IPMI_ENTITY_ID_PROCESSOR_MEMORY_MODULE		0x2B
#define IPMI_ENTITY_ID_IO_MODULE			0x2C
#define IPMI_ENTITY_ID_PROCESSOR_IO_MODULE		0x2D
#define IPMI_ENTITY_ID_MANAGEMENT_CONTROLLER_FIRMWARE	0x2E
#define IPMI_ENTITY_ID_IPMI_CHANNEL			0x2F
#define IPMI_ENTITY_ID_PCI_BUS				0x30
#define IPMI_ENTITY_ID_PCI_EXPRESS_BUS			0x31
#define IPMI_ENTITY_ID_SCSI_BUS				0x32
#define IPMI_ENTITY_ID_SATA_BUS				0x33
#define IPMI_ENTITY_ID_FRONT_SIDE_BUS			0x34
#define IPMI_ENTITY_ID_REAL_TIME_CLOCK			0x35

/*
    Device types and modifiers
*/

#define IPMI_DEVICE_DS1624                              2
#define IPMI_DEVICE_DS1621                              3
#define IPMI_DEVICE_LM75                                4
#define IPMI_DEVICE_HECETA                              5

#define IPMI_MODIFIER_HECETA_1                          0
#define IPMI_MODIFIER_HECETA_2                          1
#define IPMI_MODIFIER_LM80                              2
#define IPMI_MODIFIER_HECETA_3                          3
#define IPMI_MODIFIER_HECETA_4                          4
#define IPMI_MODIFIER_HECETA_5                          5

#define IPMI_DEVICE_EEPROM_24C01                        8
#define IPMI_DEVICE_EEPROM_24C02                        9
#define IPMI_DEVICE_EEPROM_24C04                        0xA
#define IPMI_DEVICE_EEPROM_24C08                        0xB
#define IPMI_DEVICE_EEPROM_24C16                        0xC
#define IPMI_DEVICE_EEPROM_24C17                        0xD
#define IPMI_DEVICE_EEPROM_24C32                        0xE
#define IPMI_DEVICE_EEPROM_24C64                        0xF

#define IPMI_MODIFIER_EEPROM_UNSPECIFIED                0
#define IPMI_MODIFIER_DIMM_MEMORY_ID                    1
#define IPMI_MODIFIER_IPMI_FRU_INVENTORY                2
#define IPMI_MODIFIER_SYSTEM_PROCESSOR_FRU              3

#define IPMI_DEVICE_FRU_INVENTORY                       0x10
#define IPMI_DEVICE_PCF8570                             0x14
#define IPMI_DEVICE_PCF8573                             0x15
#define IPMI_DEVICE_PCF8574A                            0x16
#define IPMI_DEVICE_PCF8583                             0x17
#define IPMI_DEVICE_PCF8593                             0x18
#define IPMI_DEVICE_CLOCK_CALENDAR                      0x19
#define IPMI_DEVICE_PCF8591                             0x1A
#define IPMI_DEVICE_IO_PORT                             0x1B
#define IPMI_DEVICE_AD_CONVERTER                        0x1C
#define IPMI_DEVICE_DA_CONVERTER                        0x1D
#define IPMI_DEVICE_AD_DA_CONVERTER                     0x1E
#define IPMI_DEVICE_LCD_CONTROLLER                      0x1F
#define IPMI_DEVICE_CORE_LOGIC                          0x20
#define IPMI_DEVICE_LMC6874                             0x21
#define IPMI_DEVICE_INTELLIGENT_BATTERY_CONTROLLER      0x22
#define IPMI_DEVICE_COMBO_MANAGEMENT_ASIC               0x23
#define IPMI_DEVICE_MAXIM1617                           0x24
#define IPMI_DEVICE_UNSPECIFIED                         0xBF

#define IPMI_DEVICE_OEM_SPECIFIED_MIN                   0xC0
#define IPMI_DEVICE_OEM_SPECIFIED_MAX                   0xFF

/*
    IPMI command codes
*/

/* Global commands (netFn=App) */
#define IPMI_GET_DEVICE_ID                              0x01
#define IPMI_COLD_RESET                                 0x02
#define IPMI_WARM_RESET                                 0x03
#define IPMI_GET_SELF_TEST_RESULTS                      0x04
#define IPMI_MANUFACTURING_TEST_ON                      0x05
#define IPMI_SET_ACPI_POWER_STATE                       0x06
#define IPMI_GET_ACPI_POWER_STATE                       0x07
#define IPMI_GET_DEVICE_GUID                            0x08
#define IPMI_GET_NETFN_SUPPORT                          0x09
#define IPMI_GET_COMMAND_SUPPORT                        0x0A
#define IPMI_GET_COMMAND_SUBFN_SUPPORT                  0x0B
#define IPMI_GET_CONFIGURABLE_COMMANDS                  0x0C
#define IPMI_GET_CONFIGURABLE_COMMAND_SUBFNS            0x0D

/* Watchdog timer commands (netFn=App) */
#define IPMI_RESET_WATCHDOG_TIMER                       0x22
#define IPMI_SET_WATCHDOG_TIMER                         0x24
#define IPMI_GET_WATCHDOG_TIMER                         0x25

/* Device and messaging commands (netFn=App) */
#define IPMI_SET_BMC_GLOBAL_ENABLES                     0x2E
#define IPMI_GET_BMC_GLOBAL_ENABLES                     0x2F
#define IPMI_CLEAR_MESSAGE_FLAGS                        0x30
#define IPMI_GET_MESSAGE_FLAGS                          0x31
#define IPMI_ENABLE_MESSAGE_CHANNEL_RECEIVE             0x32
#define IPMI_GET_MESSAGE                                0x33
#define IPMI_SEND_MESSAGE                               0x34
#define IPMI_READ_EVENT_MESSAGE_BUFFER                  0x35
#define IPMI_GET_BT_INTERFACE_CAPABILITIES              0x36
#define IPMI_GET_SYSTEM_GUID                            0x37
#define IPMI_GET_CHANNEL_AUTHENTICATION_CAPABILITIES    0x38
#define IPMI_GET_SESSION_CHALLENGE                      0x39
#define IPMI_ACTIVATE_SESSION                           0x3A
#define IPMI_SET_SESSION_PRIVILEGE_LEVEL                0x3B
#define IPMI_CLOSE_SESSION                              0x3C
#define IPMI_GET_SESSION_INFO                           0x3D
#define IPMI_GET_AUTH_CODE                              0x3F
#define IPMI_SET_CHANNEL_ACCESS                         0x40
#define IPMI_GET_CHANNEL_ACCESS                         0x41
#define IPMI_GET_CHANNEL_INFO                           0x42
#define IPMI_SET_USER_ACCESS                            0x43
#define IPMI_GET_USER_ACCESS                            0x44
#define IPMI_SET_USER_NAME                              0x45
#define IPMI_GET_USER_NAME                              0x46
#define IPMI_SET_USER_PASSWORD                          0x47
#define IPMI_ACTIVATE_PAYLOAD                           0x48
#define IPMI_DEACTIVATE_PAYLOAD                         0x49
#define IPMI_GET_PAYLOAD_ACTIVATION_STATUS              0x4A
#define IPMI_GET_PAYLOAD_INSTANCE_INFO                  0x4B
#define IPMI_SET_USER_PAYLOAD_ACCESS                    0x4C
#define IPMI_GET_USER_PAYLOAD_ACCESS                    0x4D
#define IPMI_GET_CHANNEL_PAYLOAD_SUPPORT                0x4E
#define IPMI_GET_CHANNEL_PAYLOAD_VERSION                0x4F
#define IPMI_GET_CHANNEL_OEM_PAYLOAD_INFO               0x50
#define IPMI_MASTER_WRITE_READ                          0x52
#define IPMI_GET_CHANNEL_CIPHER_SUITES                  0x54
#define IPMI_SUSPEND_RESUME_PAYLOAD_ENCRYPTION          0x55
#define IPMI_SET_CHANNEL_SECURITY_KEYS                  0x56
#define IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES          0x57
#define IPMI_SET_SYSTEM_INFO_PARAMETERS			0x58
#define IPMI_GET_SYSTEM_INFO_PARAMETERS			0x59
#define IPMI_SET_COMMAND_ENABLES			0x60
#define IPMI_GET_COMMAND_ENABLES			0x61
#define IPMI_SET_COMMAND_SUBFN_ENABLES			0x62
#define IPMI_GET_COMMAND_SUBFN_ENABLES			0x63
#define IPMI_GET_OEM_NETFN_IANA_SUPPORT			0x64

/* Chassis device commands (netFn=Chassis) */
#define IPMI_GET_CHASSIS_CAPABILITIES                   0x00
#define IPMI_GET_CHASSIS_STATUS                         0x01
#define IPMI_CHASSIS_CONTROL                            0x02
#define IPMI_CHASSIS_RESET                              0x03
#define IPMI_CHASSIS_IDENTIFY                           0x04
#define IPMI_SET_CHASSIS_CAPABILITIES                   0x05
#define IPMI_SET_POWER_RESTORE_POLICY                   0x06
#define IPMI_GET_SYSTEM_RESTART_CAUSE                   0x07
#define IPMI_SET_SYSTEM_BOOT_OPTIONS                    0x08
#define IPMI_GET_SYSTEM_BOOT_OPTIONS                    0x09
#define IPMI_GET_POH_COUNTER                            0x0F

/* Event commands (netFn=S/E) */
#define IPMI_SET_EVENT_RECEIVER                         0x00
#define IPMI_GET_EVENT_RECEIVER                         0x01
#define IPMI_PLATFORM_EVENT                             0x02

/* PEF and Alerting commands (netFn=S/E) */
#define IPMI_GET_PEF_CAPABILITIES                       0x10
#define IPMI_ARM_PEF_POSTPONE_TIMER                     0x11
#define IPMI_SET_PEF_CONFIGURATION_PARAMETERS           0x12
#define IPMI_GET_PEF_CONFIGURATION_PARAMETERS           0x13
#define IPMI_SET_LAST_PROCESSED_EVENT_ID                0x14
#define IPMI_GET_LAST_PROCESSED_EVENT_ID                0x15
#define IPMI_ALERT_IMMEDIATE                            0x16
#define IPMI_PET_ACKNOWLEDGE                            0x17

/* Sensor device commands (netFn=S/E) */
#define IPMI_GET_DEVICE_SDR_INFO                        0x20
#define IPMI_GET_DEVICE_SDR                             0x21
#define IPMI_RESERVE_DEVICE_SDR_REPOSITORY              0x22
#define IPMI_GET_SENSOR_READING_FACTORS                 0x23
#define IPMI_SET_SENSOR_HYSTERESIS                      0x24
#define IPMI_GET_SENSOR_HYSTERESIS                      0x25
#define IPMI_SET_SENSOR_THRESHOLD                       0x26
#define IPMI_GET_SENSOR_THRESHOLD                       0x27
#define IPMI_SET_SENSOR_EVENT_ENABLE                    0x28
#define IPMI_GET_SENSOR_EVENT_ENABLE                    0x29
#define IPMI_REARM_SENSOR_EVENTS                        0x2A
#define IPMI_GET_SENSOR_EVENT_STATUS                    0x2B
#define IPMI_GET_SENSOR_READING                         0x2D
#define IPMI_SET_SENSOR_TYPE                            0x2E
#define IPMI_GET_SENSOR_TYPE                            0x2F

/* FRU device commands (netFn=Storage) */
#define IPMI_GET_FRU_INVENTORY_AREA_INFO                0x10
#define IPMI_READ_FRU_DATA                              0x11
#define IPMI_WRITE_FRU_DATA                             0x12

/* SDR device commands (netFn=Storage) */
#define IPMI_GET_SDR_REPOSITORY_INFO                    0x20
#define IPMI_GET_SDR_REPOSITORY_ALLOCATION_INFO         0x21
#define IPMI_RESERVE_SDR_REPOSITORY                     0x22
#define IPMI_GET_SDR                                    0x23
#define IPMI_ADD_SDR                                    0x24
#define IPMI_PARTIAL_ADD_SDR                            0x25
#define IPMI_DELETE_SDR                                 0x26
#define IPMI_CLEAR_SDR_REPOSITORY                       0x27
#define IPMI_GET_SDR_REPOSITORY_TIME                    0x28
#define IPMI_SET_SDR_REPOSITORY_TIME                    0x29
#define IPMI_ENTER_SDR_REPOSITORY_UPDATE_MODE           0x2A
#define IPMI_EXIT_SDR_REPOSITORY_UPDATE_MODE            0x2B
#define IPMI_RUN_INITIALIZATION_AGENT                   0x2C

/* SEL device commands (netFn=Storage) */
#define IPMI_GET_SEL_INFO                               0x40
#define IPMI_GET_SEL_ALLOCATION_INFO                    0x41
#define IPMI_RESERVE_SEL                                0x42
#define IPMI_GET_SEL_ENTRY                              0x43
#define IPMI_ADD_SEL_ENTRY                              0x44
#define IPMI_PARTIAL_ADD_SEL_ENTRY                      0x45
#define IPMI_DELETE_SEL_ENTRY                           0x46
#define IPMI_CLEAR_SEL                                  0x47
#define IPMI_GET_SEL_TIME                               0x48
#define IPMI_SET_SEL_TIME                               0x49
#define IPMI_GET_AUXILIARY_LOG_STATUS                   0x5A
#define IPMI_SET_AUXILIARY_LOG_STATUS                   0x5B

/* LAN Device Commands (netFn=Transport) */
#define IPMI_SET_LAN_CONFIGURATION_PARAMETERS           0x01
#define IPMI_GET_LAN_CONFIGURATION_PARAMETERS           0x02
#define IPMI_SUSPEND_BMC_ARPS                           0x03
#define IPMI_GET_IP_UDP_RMCP_STATISTICS                 0x04

/* Serial/modem device commands (netFn=Transport) */
#define IPMI_SET_SERIAL_MODEM_CONFIGURATION             0x10
#define IPMI_GET_SERIAL_MODEM_CONFIGURATION             0x11
#define IPMI_SET_SERIAL_MODEM_MUX                       0x12
#define IPMI_GET_TAP_RESPONSE_CODES                     0x13
#define IPMI_SET_PPP_UDP_PROXY_TRANSMIT_DATA            0x14
#define IPMI_GET_PPP_UDP_PROXY_TRANSMIT_DATA            0x15
#define IPMI_SEND_PPP_UDP_PROXY_PACKET                  0x16
#define IPMI_GET_PPP_UDP_PROXY_RECEIVE_DATA             0x17
#define IPMI_SERIAL_MODEM_CONNECTION_ACTIVE             0x18
#define IPMI_CALLBACK                                   0x19
#define IPMI_SET_USER_CALLBACK_OPTIONS                  0x1A
#define IPMI_GET_USER_CALLBACK_OPTIONS                  0x1B
#define IPMI_SET_SERIAL_ROUTING_MUX			0x1C

/* SOL commands (netFn=Transport) */
#define IPMI_SOL_ACTIVATING                             0x20
#define IPMI_SET_SOL_CONFIGURATION_PARAMETERS           0x21
#define IPMI_GET_SOL_CONFIGURATION_PARAMETERS           0x22

/* Command forwarding commands netFn=Transport*/
#define IPMI_FORWARDED_COMMAND				0x30
#define IPMI_SET_FORWARDED_COMMANDS			0x31
#define IPMI_GET_FORWARDED_COMMANDS			0x32
#define IPMI_ENABLE_FORWARDED_COMMANDS			0x33

/* Bridge management commands (ICMB, netFn=Bridge) */
#define IPMI_GET_BRIDGE_STATE                           0x00
#define IPMI_SET_BRIDGE_STATE                           0x01
#define IPMI_GET_ICMB_ADDRESS                           0x02
#define IPMI_SET_ICMB_ADDRESS                           0x03
#define IPMI_SET_BRIDGE_PROXY_ADDRESS                   0x04
#define IPMI_GET_BRIDGE_STATISTICS                      0x05
#define IPMI_GET_ICMB_CAPABILITIES                      0x06
#define IPMI_CLEAR_BRIDGE_STATISTICS                    0x08
#define IPMI_GET_BRIDGE_PROXY_ADDRESS                   0x09
#define IPMI_GET_ICMB_CONNECTOR_INFO                    0x0A
#define IPMI_GET_ICMB_CONNECTION_ID                     0x0B
#define IPMI_SEND_ICMB_CONNECTION_ID                    0x0C

/* Discovery commands (ICMB, netFn=Bridge) */
#define IPMI_PREPARE_FOR_DISCOVERY                      0x10
#define IPMI_GET_ADDRESSES                              0x11
#define IPMI_SET_DISCOVERED                             0x12
#define IPMI_GET_CHASSIS_DEVICE_ID                      0x13
#define IPMI_SET_CHASSIS_DEVICE_ID                      0x13

/* Bridging commands (ICMB, netFn=Bridge) */
#define IPMI_BRIDGE_REQUEST                             0x20
#define IPMI_BRIDGE_MESSAGE                             0x21

/* Event commands (ICMB, netFn=Bridge) */
#define IPMI_GET_EVENT_COUNT                            0x30
#define IPMI_SET_EVENT_DESTINATION                      0x31
#define IPMI_SET_EVENT_RECEPTION_STATE                  0x32
#define IPMI_SEND_ICMB_EVENT_MESSAGE                    0x33
#define IPMI_GET_EVENT_DESTINATION                      0x34
#define IPMI_GET_EVENT_RECEPTION_STATE                  0x35

#define IPMI_BRIDGE_ERROR_REPORT                        0xFF

/* Channel numbers */
#define IPMI_CHANNEL_PRIMARY_IPMB                       0x00
#define IPMI_CHANNEL_OEM_START                          0x01
#define IPMI_CHANNEL_OEM_END                            0x07
#define IPMI_CHANNEL_SELF                               0x0E
#define IPMI_CHANNEL_SYSTEM_INTERFACE                   0x0F
#define IPMI_MAX_CHANNELS				0x10

/* Channel medium types */
#define IPMI_CHANNEL_MEDIUM_IPMB                        0x01
#define IPMI_CHANNEL_MEDIUM_ICMB_V1_0                   0x02
#define IPMI_CHANNEL_MEDIUM_ICMB_V0_9                   0x03
#define IPMI_CHANNEL_MEDIUM_LAN_802_3                   0x04
#define IPMI_CHANNEL_MEDIUM_SERIAL                      0x05
#define IPMI_CHANNEL_MEDIUM_LAN_OTHER                   0x06
#define IPMI_CHANNEL_MEDIUM_PCI_SMBUS                   0x07
#define IPMI_CHANNEL_MEDIUM_SMBUS_V1_X                  0x08
#define IPMI_CHANNEL_MEDIUM_SMBUS_V2_0                  0x09
#define IPMI_CHANNEL_MEDIUM_USB_V1_X                    0x0A
#define IPMI_CHANNEL_MEDIUM_USB_V2_X                    0x0B
#define IPMI_CHANNEL_MEDIUM_SYSTEM_INTERFACE            0x0C
#define IPMI_CHANNEL_MEDIUM_OEM_MIN                     0x60
#define IPMI_CHANNEL_MEDIUM_OEM_MAX                     0x7F

/* IPMI Channel protocols */
#define IPMI_CHANNEL_PROTO_IPMB_10			0x01
#define IPMI_CHANNEL_PROTO_ICMB_10			0x02
#define IPMI_CHANNEL_PROTO_IPMI_SMBUS			0x04
#define IPMI_CHANNEL_PROTO_KCS				0x05
#define IPMI_CHANNEL_PROTO_SMIC				0x06
#define IPMI_CHANNEL_PROTO_BT_10			0x07
#define IPMI_CHANNEL_PROTO_BT_15			0x08
#define IPMI_CHANNEL_PROTO_TMODE			0x09
#define IPMI_CHANNEL_PROTO_OEM1				0x1C
#define IPMI_CHANNEL_PROTO_OEM2				0x1D
#define IPMI_CHANNEL_PROTO_OEM3				0x1E
#define IPMI_CHANNEL_PROTO_OEM4				0x1F

/* IPMI Channel session support */
#define IPMI_CHANNEL_SESSIONLESS			0x00
#define IPMI_CHANNEL_SINGLE_SESSION			0x01
#define IPMI_CHANNEL_MULTI_SESSION			0x02
#define IPMI_CHANNEL_SESSION_BASED			0x03

/* Privilege levels */
#define IPMI_PRIVILEGE_LEVEL_NONE                       0
#define IPMI_PRIVILEGE_LEVEL_CALLBACK                   1
#define IPMI_PRIVILEGE_LEVEL_USER                       2
#define IPMI_PRIVILEGE_LEVEL_OPERATOR                   3
#define IPMI_PRIVILEGE_LEVEL_ADMINISTRATOR              4
#define IPMI_PRIVILEGE_LEVEL_OEM_PROPRIETARY            5
#define IPMI_PRIVILEGE_LEVEL_NO_ACCESS                  15

/*
    LAN configuration parameter numbers
*/

#define IPMI_LAN_CFG_SET_IN_PROGRESS			0
#define IPMI_LAN_CFG_AUTH_TYPE_SUPPORT			1
#define IPMI_LAN_CFG_AUTH_TYPE_ENABLES			2
#define IPMI_LAN_CFG_IP_ADDRESS				3
#define IPMI_LAN_CFG_IP_ADDRESS_SOURCE			4
#define IPMI_LAN_CFG_MAC_ADDRESS			5
#define IPMI_LAN_CFG_SUBNET_MASK			6
#define IPMI_LAN_CFG_IPV4_HEADER_PARAMETERS		7
#define IPMI_LAN_CFG_PRIMARY_RMCP_PORT_NUMBER		8
#define IPMI_LAN_CFG_SECONDARY_RMCP_PORT_NUMBER		9
#define IPMI_LAN_CFG_BMC_GENERATED_ARP_CONTROL		10
#define IPMI_LAN_CFG_GRATUITOUS_ARP_INTERVAL		11
#define IPMI_LAN_CFG_DEFAULT_GATEWAY_IP_ADDRESS		12
#define IPMI_LAN_CFG_DEFAULT_GATEWAY_MAC_ADDRESS	13
#define IPMI_LAN_CFG_BACKUP_GATEWAY_IP_ADDRESS		14
#define IPMI_LAN_CFG_BACKUP_GATEWAY_MAC_ADDRESS		15
#define IPMI_LAN_CFG_COMMUNITY_STRING			16
#define IPMI_LAN_CFG_NUMBER_OF_DESTINATIONS		17
#define IPMI_LAN_CFG_DESTINATION_TYPE			18
#define IPMI_LAN_CFG_DESTINATION_ADDRESS		19
#define IPMI_LAN_CFG_IPV6_SUPPORT			50
#define IPMI_LAN_CFG_IPV6_ENABLES			51
#define IPMI_LAN_CFG_IPV6_TRAFFIC_CLASS			52
#define IPMI_LAN_CFG_IPV6_STATIC_HOP_LIMIT		53
#define IPMI_LAN_CFG_IPV6_FLOW_LABEL			54
#define IPMI_LAN_CFG_IPV6_STATUS			55
#define IPMI_LAN_CFG_IPV6_STATIC_ADDRS			56
#define IPMI_LAN_CFG_IPV6_STATIC_DUID_LEN		57
#define IPMI_LAN_CFG_IPV6_STATIC_DUIDS			58
#define IPMI_LAN_CFG_IPV6_DYNAMIC_ADDRS			59
#define IPMI_LAN_CFG_IPV6_DYNAMIC_DUID_LEN		60
#define IPMI_LAN_CFG_IPV6_DYNAMIC_DUIDS			61
#define IPMI_LAN_CFG_IPV6_DHCPV6_CFG_SUPPORT		62
#define IPMI_LAN_CFG_IPV6_DHCPV6_CFG			63
#define IPMI_LAN_CFG_IPV6_ROUTER_CFG_CTRL		64
#define IPMI_LAN_CFG_IPV6_STATIC_ROUTER1_IP		65
#define IPMI_LAN_CFG_IPV6_STATIC_ROUTER1_MAC		66
#define IPMI_LAN_CFG_IPV6_STATIC_ROUTER1_PREFIX_LEN	67
#define IPMI_LAN_CFG_IPV6_STATIC_ROUTER1_PREFIX		68
#define IPMI_LAN_CFG_IPV6_STATIC_ROUTER2_IP		69
#define IPMI_LAN_CFG_IPV6_STATIC_ROUTER2_MAC		70
#define IPMI_LAN_CFG_IPV6_STATIC_ROUTER2_PREFIX_LEN	71
#define IPMI_LAN_CFG_IPV6_STATIC_ROUTER2_PREFIX		72
#define IPMI_LAN_CFG_IPV6_NUM_DYNAMIC_ROUTER_INFO	73
#define IPMI_LAN_CFG_IPV6_DYNAMIC_ROUTER_IP		74
#define IPMI_LAN_CFG_IPV6_DYNAMIC_ROUTER_MAC		75
#define IPMI_LAN_CFG_IPV6_DYNAMIC_ROUTER_PREFIX_LEN	76
#define IPMI_LAN_CFG_IPV6_DYNAMIC_ROUTER_PREFIX		77
#define IPMI_LAN_CFG_IPV6_DYNAMIC_HOP_LIMIT		78
#define IPMI_LAN_CFG_IPV6_NDISC_CFG_SUPPORT		79
#define IPMI_LAN_CFG_IPV6_NDISC_CFG			80

/* The following parameters were introduced with IPMI 2.0 / RMCP+ */
#define IPMI_LAN_CFG_VLAN_ID				20
#define IPMI_LAN_CFG_VLAN_PRIORITY			21
#define IPMI_LAN_CFG_RMCPP_CIPHER_SUITE_ENTRY_SUPPORT	22
#define IPMI_LAN_CFG_RMCPP_CIPHER_SUITE_ENTRIES		23
#define IPMI_LAN_CFG_RMCPP_CIPHER_SUITE_PRIV_LEVELS     24
#define IPMI_LAN_CFG_DESTINATION_ADDRESS_VLAN_TAGS	25

#define IPMI_LAN_CFG_IP_ENABLES				51

/*
    LAN configuration IP_ADDRESS_SOURCE parameter data
*/
#define IP_SOURCE_UNSPECIFIED	0
#define IP_SOURCE_STATIC	1
#define IP_SOURCE_DHCP		2
#define IP_SOURCE_BIOS		3
#define IP_SOURCE_OTHER		4
#define IP_SOURCE_MAX		IP_SOURCE_OTHER
/*
    Serial configuration parameter numbers
*/
#define IPMI_SERIAL_CFG_SET_IN_PROGRESS			0
#define IPMI_SERIAL_CFG_AUTH_TYPE			1
#define IPMI_SERIAL_CFG_AUTH_TYPE_ENABLES		2
#define IPMI_SERIAL_CFG_CONNECTION_MODE			3
#define IPMI_SERIAL_CFG_SESSION_INACTIVITY_TIMEOUT	4
#define IPMI_SERIAL_CFG_CHANNEL_CALLBACK_CONTROL	5
#define IPMI_SERIAL_CFG_SESSION_TERMINATION		6
#define IPMI_SERIAL_CFG_IPMI_MSG_COMM_SETTINGS		7
#define IPMI_SERIAL_CFG_MUX_SWITCH_CONTROL		8
#define IPMI_SERIAL_CFG_MODEM_RING_TIME			9
#define IPMI_SERIAL_CFG_MODEM_INIT_STRING		10
#define IPMI_SERIAL_CFG_MODEM_ESCAPE_SEQUENCE		11
#define IPMI_SERIAL_CFG_MODEM_HANGUP_SEQUENCE		12
#define IPMI_SERIAL_CFG_MODEM_DIAL_COMMAND		13
#define IPMI_SERIAL_CFG_PAGE_BLACKOUT_INTERVAL		14
#define IPMI_SERIAL_CFG_COMMUNITY_STRING		15
#define IPMI_SERIAL_CFG_NUM_ALERT_DESTINATIONS		16
#define IPMI_SERIAL_CFG_DESTINATION_INFO		17
#define IPMI_SERIAL_CFG_CALL_RETRY_INTERVAL		18
#define IPMI_SERIAL_CFG_DESTINATION_COMM_SETTINGS	19
#define IPMI_SERIAL_CFG_NUM_DIAL_STRINGS		20
#define IPMI_SERIAL_CFG_DESTINATION_DIAL_STRINGS	21
#define IPMI_SERIAL_CFG_NUM_DESTINATION_IP_ADDRS	22
#define IPMI_SERIAL_CFG_DESTINATION_IP_ADDRS		23
#define IPMI_SERIAL_CFG_NUM_TAP_ACCOUNTS		24
#define IPMI_SERIAL_CFG_TAP_ACCOUNT			25
#define IPMI_SERIAL_CFG_TAP_PASSWORD			26
#define IPMI_SERIAL_CFG_TAP_PAGER_ID_STRING		27
#define IPMI_SERIAL_CFG_TAP_SERVICE_SETTINGS		28
#define IPMI_SERIAL_CFG_TERMINAL_MODE_CONFIG		29
#define IPMI_SERIAL_CFG_PPP_PROTO_OPTIONS		30
#define IPMI_SERIAL_CFG_PPP_PRIMARY_RMCP_PORT		31
#define IPMI_SERIAL_CFG_PPP_SECONDARY_RMCP_PORT		32
#define IPMI_SERIAL_CFG_PPP_LINK_AUTH			33
#define IPMI_SERIAL_CFG_CHAP_NAME			34
#define IPMI_SERIAL_CFG_PPP_ACCM			35
#define IPMI_SERIAL_CFG_PPP_SNOOP_ACCM			36
#define IPMI_SERIAL_CFG_NUM_PPP_ACCOUNTS		37
#define IPMI_SERIAL_CFG_PPP_ACCOUNT_DIAL_STRING_SEL	38
#define IPMI_SERIAL_CFG_PPP_ACCOUNT_IP_ADDR		39
#define IPMI_SERIAL_CFG_PPP_ACCOUNT_USER_NAMES		40
#define IPMI_SERIAL_CFG_PPP_ACCOUNT_USER_DOMAINS	41
#define IPMI_SERIAL_CFG_PPP_ACCOUNT_USER_PASSWORDS	42
#define IPMI_SERIAL_CFG_PPP_ACCOUNT_AUTH_SETTINGS	43
#define IPMI_SERIAL_CFG_PPP_ACCOUNT_CONNECTION_HOLD	44
#define IPMI_SERIAL_CFG_PPP_PROXY_IP_HEADER		45
#define IPMI_SERIAL_CFG_PPP_PROXY_TX_BUFSIZE		46
#define IPMI_SERIAL_CFG_PPP_PROXY_RX_BUFSIZE		47
#define IPMI_SERIAL_CFG_PPP_REMOTE_IP_ADDR		48
#define IPMI_SERIAL_CFG_SYSTEM_PHONE			49
#define IPMI_SERIAL_CFG_BITRATE_SUPPORT			50
#define IPMI_SERIAL_CFG_SYSTEM_SERIAL_PORT_ASSOC	51
#define IPMI_SERIAL_CFG_SYSTEM_CONNECTOR_NAMES		52
#define IPMI_SERIAL_CFG_SYSTEM_SERIAL_CHANNEL_NAMES	53

/*
    SOL configuration parameter numbers
*/

#define IPMI_SOL_CFG_SET_IN_PROGRESS			0
#define IPMI_SOL_CFG_SOL_ENABLE				1
#define IPMI_SOL_CFG_SOL_AUTHENTICATION			2
#define IPMI_SOL_CFG_CHARACTER_ACCUMULATE_INTERVAL	3
#define IPMI_SOL_CFG_SOL_RETRY				4
#define IPMI_SOL_CFG_SOL_NONVOLATILE_BIT_RATE		5
#define IPMI_SOL_CFG_SOL_VOLATILE_BIT_RATE		6
#define IPMI_SOL_CFG_SOL_PAYLOAD_CHANNEL		7
#define IPMI_SOL_CFG_SOL_PAYLOAD_PORT_NUMBER		8

/*
    IPMI Device Capabilities (used in Management Controller Locator Records
    and Get Device ID commands).
*/
#define IPMI_DEVCAP_SENSOR			0x01
#define IPMI_DEVCAP_SDR_REPOSITORY		0x02
#define IPMI_DEVCAP_SEL				0x04
#define IPMI_DEVCAP_FRU_INVENTORY		0x08
#define IPMI_DEVCAP_EVENT_RECEIVER		0x10
#define IPMI_DEVCAP_EVENT_GENERATOR		0x20
#define IPMI_DEVCAP_BRIDGE			0x40
#define IPMI_DEVCAP_CHASSIS			0x80



/* Message control support values */

#define IPMI_SENSOR_EVENT_ENABLE_PER_THRESHOLD_STATE    0
#define IPMI_SENSOR_EVENT_ENABLE_ENTIRE_SENSOR_ONLY     1
#define IPMI_SENSOR_EVENT_GLOBAL_DISABLE_ONLY           2
#define IPMI_SENSOR_NO_EVENTS                           3

/* Threshold access */

#define IPMI_SENSOR_NO_THRESHOLDS                       0
#define IPMI_SENSOR_THRESHOLDS_READABLE                 1
#define IPMI_SENSOR_THRESHOLDS_SETTABLE                 2
#define IPMI_SENSOR_THRESHOLDS_FIXED                    3

/* Hysteresis support */

#define IPMI_SENSOR_NO_HYSTERESIS                       0
#define IPMI_SENSOR_HYSTERESIS_READABLE                 1
#define IPMI_SENSOR_HYSTERESIS_SETTABLE                 2
#define IPMI_SENSOR_HYSTERESIS_FIXED                    3

/* Modifier units */

#define IPMI_MODIFIER_UNIT_NONE                         0
#define IPMI_MODIFIER_UNIT_DIVISOR                      1
#define IPMI_MODIFIER_UNIT_MULTIPLIER                   2

/* Rate unit */

#define IPMI_RATE_UNIT_NONE                             0
#define IPMI_RATE_UNIT_MICROSECONDS                     1
#define IPMI_RATE_UNIT_MILLISECONDS                     2
#define IPMI_RATE_UNIT_SECONDS                          3
#define IPMI_RATE_UNIT_MINUTES                          4
#define IPMI_RATE_UNIT_HOURS                            5
#define IPMI_RATE_UNIT_DAYS                             6

/* Analog data format */

#define IPMI_ANALOG_FORMAT_UNSIGNED                     0
#define IPMI_ANALOG_FORMAT_ONES_COMPLEMENT              1
#define IPMI_ANALOG_FORMAT_TWOS_COMPLEMENT              2
#define IPMI_NO_ANALOG_READING                          3

/* ID string modifier types */

#define IPMI_ID_STRING_MODIFIER_NUMERIC                 0
#define IPMI_ID_STRING_MODIFIER_ALPHA                   1



/* Global initialization values */

#define IPMI_ENABLE_EVENT_MESSAGE_GENERATION            0
#define IPMI_DISABLE_EVENT_MESSAGE_GENERATION           1
#define IPMI_DO_NOT_INITIALIZE_CONTROLLER               2
#define IPMI_LOG_INITIALIZATION_AGENT_ERROR             4
#define IPMI_CONTROLLER_LOGS_INIT_AGENT_ERRORS          8

/* Power state notification values */

#define IPMI_STATIC_CONTROLLER                          2
#define IPMI_DEVICE_POWER_STATE_NOTIFICATION_REQUIRED   4
#define IPMI_SYSTEM_POWER_STATE_NOTIFICATION_REQUIRED   8

/* manufacturer ID type */
typedef unsigned char manufacturer_id_t[3];

/* Timer use values and flags */

#define IPMI_WATCHDOG_USE_BIOS_FRB2                     0x01
#define IPMI_WATCHDOG_USE_BIOS_POST                     0x02
#define IPMI_WATCHDOG_USE_OS_LOAD                       0x03
#define IPMI_WATCHDOG_USE_SMS_OS                        0x04
#define IPMI_WATCHDOG_USE_OEM                           0x05
#define IPMI_WATCHDOG_DONT_STOP                         0x40
#define IPMI_WATCHDOG_TIMER_IS_RUNNING                  0x40
#define IPMI_WATCHDOG_DONT_LOG                          0x80

/* Timeout action */

#define IPMI_WATCHDOG_ACTION_NONE                       0x00
#define IPMI_WATCHDOG_ACTION_RESET                      0x01
#define IPMI_WATCHDOG_ACTION_POWER_DOWN                 0x02
#define IPMI_WATCHDOG_ACTION_POWER_CYCLE                0x03

/* Pre-timeout interrupt */

#define IPMI_WATCHDOG_INTERRUPT_NONE                    0x00
#define IPMI_WATCHDOG_INTERRUPT_SMI                     0x01
#define IPMI_WATCHDOG_INTERRUPT_NMI_DIAG                0x02
#define IPMI_WATCHDOG_INTERRUPT_MESSAGING               0x03

/* Timer use expiration flags clear */

#define IPMI_WATCHDOG_EXPIRATION_CLEAR_BIOS_FRB2        0x02
#define IPMI_WATCHDOG_EXPIRATION_CLEAR_BIOS_POST        0x04
#define IPMI_WATCHDOG_EXPIRATION_CLEAR_OS_LOAD          0x08
#define IPMI_WATCHDOG_EXPIRATION_CLEAR_SMS_OS           0x10
#define IPMI_WATCHDOG_EXPIRATION_CLEAR_OEM              0x20

/* Bits definitions for BMC Global Enables commands */

#define IPMI_BMC_GLOBAL_RMQ_ENABLE	(1 << 0)
#define IPMI_BMC_GLOBAL_EMBFI_ENABLE	(1 << 1)
#define IPMI_BMC_GLOBAL_EMB_ENABLE	(1 << 2)
#define IPMI_BMC_GLOBAL_SEL_ENABLE	(1 << 3)
#define IPMI_BMC_GLOBAL_OEM0_ENABLE	(1 << 5)
#define IPMI_BMC_GLOBAL_OEM1_ENABLE	(1 << 6)
#define IPMI_BMC_GLOBAL_OEM2_ENABLE	(1 << 7)

/* Bits definitions for Message Flags commands */

#define IPMI_MESSAGE_FLAGS_RMQ		(1 << 0)
#define IPMI_MESSAGE_FLAGS_EMB		(1 << 1)
#define IPMI_MESSAGE_FLAGS_WD		(1 << 3)
#define IPMI_MESSAGE_FLAGS_OEM0		(1 << 5)
#define IPMI_MESSAGE_FLAGS_OEM1		(1 << 6)
#define IPMI_MESSAGE_FLAGS_OEM2		(1 << 7)

/* Sensor Event Log (SEL) definitions */

#define SEL_VERSION		0x51
#define SEL_OVERFLOW		0x80
#define SEL_RESERVE_SUPPORT	0x02

#define SEL_SYSTEM_EVENT	0x02
#define SEL_OEM_TS_EVENT	0xc0
#define SEL_OEM_NON_TS_EVENT	0xe0
#define SEL_EVM_VERSION		0x04


#define IPMI_EVENT_DISCRETE_DATA1_BYTE2_MASK		0xC0
#define IPMI_EVENT_DISCRETE_DATA1_BYTE2_UNSPECIFIED	0x00
#define IPMI_EVENT_DISCRETE_DATA1_BYTE2_PREV_STATE	0x40
#define IPMI_EVENT_DISCRETE_DATA1_BYTE2_OEM		0x80
#define IPMI_EVENT_DISCRETE_DATA1_BYTE2_EXT_CODE	0xC0
#define IPMI_EVENT_DISCRETE_DATA1_BYTE3_MASK		0x30
#define IPMI_EVENT_DISCRETE_DATA1_BYTE3_UNSPECIFIED	0x00
#define IPMI_EVENT_DISCRETE_DATA1_BYTE3_OEM		0x20
#define IPMI_EVENT_DISCRETE_DATA1_BYTE3_EXT_CODE	0x30
#define IPMI_EVENT_DISCRETE_DATA1_OFFSET_MASK		0x0F

/* IPMI_GET_DEVICE_ID */

#define	IPMI_VERSION_1_5			0x51
#define	IPMI_VERSION_2_0			0x02

/* Device revision subfields */

#define IPMI_DEVICE_REVISION_MASK                       0xF
#define IPMI_DEVICE_PROVIDES_SDRS                       0x80

/* Firmware revision 1 subfields */

#define IPMI_FIRMWARE_REVISION_1_MASK                   0x7F
#define IPMI_SELF_INITIALIZATION_IN_PROGRESS            0x80

/* Flags in additional device support */

#define IPMI_IS_SENSOR_DEVICE                           1
#define IPMI_IS_SDR_REPOSITORY_DEVICE                   2
#define IPMI_IS_SEL_DEVICE                              4
#define IPMI_IS_FRU_INVENTORY_DEVICE                    8
#define IPMI_IS_IPMB_EVENT_RECEIVER                     0x10
#define IPMI_IS_IPMB_EVENT_GENERATOR                    0x20
#define IPMI_IS_BRIDGE_DEVICE                           0x40
#define IPMI_IS_CHASSIS_DEVICE                          0x80


#endif /* __IPMIDEFS_H__ */
